#pragma once
#ifndef FRMLOGIN_H
#define FRMLOGIN_H


#include <QtCore>
#include <QtGui>
#include <string>
#include "IceCastHttp.h"

class LoginForm : public QDialog
{
	Q_OBJECT

public:
	LoginForm();
	~LoginForm();

	virtual void showMessage(QString text);

	virtual int showQuestion(QString text);

	bool isCancel();

	virtual int exec();

signals:
	void onLogin(const char *url, const char *user, const char *pass);
	void onCancel();

private slots:
	void slotLogin();
	void slotCancel();

private:

	// controls
	QGroupBox *m_grpLogin;
	QLabel *m_lblUser;
	QLabel *m_lblPassword;
	QLabel *m_lblURLBase;
	QLineEdit *m_txtUser;
	QLineEdit *m_txtPassword;
	QLineEdit *m_txtURLBase;
	QPushButton *m_btnLogin;
	QPushButton *m_btnCancel;
	QHBoxLayout *m_layMainLayout;
	QWidget *m_wdgMainWidget;

	QMessageBox m_msgBox;
	virtual void createInterface();
	void enableInputs(bool bEnabled);

	int SIZE_BASE;
	bool m_bIsCancel;
};

#endif // FRMLOGIN_H
